USE [PGI]
GO
/****** Object:  UserDefinedFunction [dbo].[FnEncripta]    Script Date: 11/04/2013 23:40:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE  FUNCTION [dbo].[FnEncripta]
(
	@clave varchar(32), @semilla varchar(100)
)
	returns NVARCHAR(32)
		as
		begin
			declare @pass as NVARCHAR(32)
			set @pass=CONVERT(NVARCHAR(32),HashBytes('MD5',@clave),2)
			return @pass
		end